#include <unistd.h>
#include <stdio.h>
#include <stdlib.h>
#include <fcntl.h>
#include <string.h>
#include <linux/fb.h>
#include <sys/mman.h>
#include <sys/ioctl.h>
#include <arpa/inet.h>
#include <errno.h>
#include "device.h"
#include "image.h"
#include "bmp.h"
#include "jpeg.h"

deviceInformation device_fb0;
imageInformation image;

int main(int argc, char *argv[])
{

	FBDeviceInit("/dev/fb0", &device_fb0);
//	strcpy(image->path,argv[1]);
	image.path=argv[1];
	switch(argv[2][0])
	{
	case '1':
		show_bmp(&device_fb0,&image);
		break;
	case '2':
		show_jpeg(&device_fb0,&image);
		break;
	default:break;	
	}
	
	FBDeviceDestory(&device_fb0);

	return 0;
}

